<template>
	<view style='padding:10px;'>
		<view v-if='logs && logs.length > 0'>
			<view v-for='item in logs'>
				<u-divider :text="$u.timeFormat(new Date(item.createdTime), 'yyyy年mm月dd日')"></u-divider>
				<view >
					<view v-for='(img,index) in item.images' :key='index' @click="zoomImage(index,item.images)">
						<img :src='img' style='width:200px;height:200px' />
					</view>
				</view>
			</view>
		</view>
		<view v-else>
			<view style='margin-top: 30vh;'>
				<u-empty mode="history" text='暂无积分申请'>
				</u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				logs: [],

			};
		},
		onShow() {

		},
		onLoad() {
			this.getPointApplies()
		},
		methods: {
			getPointApplies() {
				this.request.get(`api/point-applies`, {
					'@filter': `entity.getStatus() == 'pending'`
				}).then((res) => {
					console.log(res.data)
					this.logs = res.data
				})
			},
			zoomImage(index,images) {
				console.log(index,images)
			      // 使用uni的API来放大图片
			      uni.previewImage({
			        current: images[index], // 当前显示图片的链接
			        urls: images // 需要预览的图片链接列表
			      });
			    }
		}
	}
</script>

<style>

</style>